//
// Created by Administrator on 2021/10/21.
//

#ifndef MRENDER_CAMERA_H
#define MRENDER_CAMERA_H


#include "../core/Object3D.h"
#include "../math/Matrix4x4.h"
#include "../geometries/BoxBufferGeometry.h"
#include "../geometries/ConeBufferGeometry.h"

enum CameraTypeEnum{
    /**
     * 正交
     */
    ORTHO = 0,
    /**
     * 透视
     */
    PERSP = 1
};

class Camera : public Object3D{
private:
    CameraTypeEnum cameraType;
public:
    //定义盒子范围
    float left, right, bottom, top, nearplan, farplan;
    //观察点
    Vector3 target;
    /**
     * 开启预览
     */
    bool bPreview = false;
    /**
     * 是否跟随窗口变化
     */
    bool bFramebuffSizeCallback = true;
public:
    void onInit() override;
    void drawUI() override;
public:
    Camera();
    ~Camera();

    /**
     * 获得投影矩阵
     * @return 矩阵
     */
    virtual Matrix4x4 getProjectionMatrix() = 0;

    /**
     * 获得视图矩阵
     * @return 矩阵
     */
    virtual Matrix4x4 getViewMatrix() = 0;
};


#endif //MRENDER_CAMERA_H
